package jeu;

import game.Scores;

import javax.swing.JFrame;

import devintAPI.MenuAbstrait;


public class ChoixNomEffacer extends MenuAbstrait {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	JFrame framePlateau;

	public ChoixNomEffacer(String title) {
		super(title);
		voix.playShortText("Choisis la partie que tu veux effacer");
	}

	@Override
	protected String[] nomOptions() {
		String[] noms = new String[Scores.findPlayers().size() + 1];
		int i = 0;
		for (String player : Scores.findPlayers()) {
			noms[i++] = player;
		}
		noms[i] = "Retour";
		return noms;
	}

	@Override
	protected void lancerOption(int i) {

		if (i == Scores.findPlayers().size()) {
			new DisplayScoresUser(Scores.writeScore());
			this.dispose();
		} else {
			Object[] tab = Scores.findPlayers().toArray();
			Elements.nomUser = (String) tab[i];
			new EffacerPartie((String) tab[i]);
			dispose();
		}
	}

	@Override
	protected String wavAccueil() {
		return null;
	}

	@Override
	protected String wavRegleJeu() {
		return null;
	}

	public JFrame getFramePlateau() {
		return framePlateau;
	}


}
